<?PHP

// 房源多图 
function fangyuan_imgnum($chid,$aid){
	global $db,$tblprefix;
	$imgsql = "SELECT( 
	  (SELECT COUNT(*) FROM {$tblprefix}aalbum_xqt WHERE pid ='$aid')+
	  (SELECT COUNT(*) FROM {$tblprefix}aalbum_hxt WHERE pid ='$aid')) AS imginum ";
	$imgnum = $db->result_one($imgsql); //$imgnum++; 
	$imgsql = "UPDATE {$tblprefix}".atbl($chid)." SET imgnum='$imgnum' WHERE aid ='$aid'";
	//die($imgsql);
	$db->query($imgsql);
}

?>